// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   TradingTabSclPane.java

package com.boci.clientapp.trading;

import com.boci.clientapp.main.ApplicationService;
import com.boci.common.ui.AbstractTabSclPane;
import java.util.Locale;

// Referenced classes of package com.boci.clientapp.trading:
//            TradingScrPanel, TrdReviewScrPanel, TrdConfirmScrPanel, OptionScrPanel, 
//            OptReviewScrPanel, OptConfirmScrPanel

public class TradingTabSclPane extends AbstractTabSclPane
{

    public TradingTabSclPane(Locale pLocale)
    {
        super(pLocale);
        tradingPanel = new TradingScrPanel(pLocale, "TRADING_MODULE", "TRADING_SCREEN");
        reviewPanel = new TrdReviewScrPanel(pLocale, "TRADING_MODULE", "REVIEW_TRADING_SCREEN");
        confirmPanel = new TrdConfirmScrPanel(pLocale, "TRADING_MODULE", "CONFIRM_TRADING_SCREEN");
        optionPanel = new OptionScrPanel(pLocale, "TRADING_MODULE", "OPTION_SCREEN");
        optReviewPanel = new OptReviewScrPanel(pLocale, "TRADING_MODULE", "REVIEW_OPTION_SCREEN");
        optConfirmPanel = new OptConfirmScrPanel(pLocale, "TRADING_MODULE", "CONFIRM_OPTION_SCREEN");
        addPanel("TRADING_SCREEN", tradingPanel);
        addPanel("REVIEW_TRADING_SCREEN", reviewPanel);
        addPanel("CONFIRM_TRADING_SCREEN", confirmPanel);
        addPanel("OPTION_SCREEN", optionPanel);
        addPanel("REVIEW_OPTION_SCREEN", optReviewPanel);
        addPanel("CONFIRM_OPTION_SCREEN", optConfirmPanel);
        showScreen("TRADING_SCREEN");
    }

    public void showScreen(String pStrScreen, boolean pRefreshPanel)
    {
        ApplicationService appServ = ApplicationService.getInstance();
        if(appServ != null)
            if(pStrScreen.equals("REVIEW_TRADING_SCREEN") || pStrScreen.equals("CONFIRM_TRADING_SCREEN") || pStrScreen.equals("REVIEW_OPTION_SCREEN") || pStrScreen.equals("CONFIRM_OPTION_SCREEN"))
                appServ.enableAcctNo(false);
            else
                appServ.enableAcctNo(true);
        super.showScreen(pStrScreen, pRefreshPanel);
    }

    public void backToTradingScreen()
    {
        ApplicationService appServ = ApplicationService.getInstance();
        appServ.enableAcctNo(true);
        tradingPanel.setVisible(true);
        reviewPanel.setVisible(false);
        confirmPanel.setVisible(false);
        optionPanel.setVisible(false);
        optReviewPanel.setVisible(false);
        optConfirmPanel.setVisible(false);
    }

    public void backToOptionScreen()
    {
        ApplicationService appServ = ApplicationService.getInstance();
        appServ.enableAcctNo(true);
        tradingPanel.setVisible(false);
        reviewPanel.setVisible(false);
        confirmPanel.setVisible(false);
        optionPanel.setVisible(true);
        optReviewPanel.setVisible(false);
        optConfirmPanel.setVisible(false);
        optionPanel.setDefFocus();
    }

    public String getModuleName()
    {
        return "TRADING_MODULE";
    }

    public void showDefaultScr()
    {
        showScreen("TRADING_SCREEN");
        tradingPanel.chgMarket("HK_MARKET");
    }

    TradingScrPanel tradingPanel;
    TrdReviewScrPanel reviewPanel;
    TrdConfirmScrPanel confirmPanel;
    OptionScrPanel optionPanel;
    OptReviewScrPanel optReviewPanel;
    OptConfirmScrPanel optConfirmPanel;
}
